Stability in Sorting Algorithms
Stable sorting algorithms: Merge Sort, Insertion Sort, Bubble Sort, Timsort
Unstable sorting algorithms: Quick Sort (typical implementation), Heap Sort, Selection Sort
Stability is essential for multi-key sorting (sort by key A, then stably by key B)
Some unstable algorithms can be made stable by adding index-based tie-breaking, at the cost of extra memory